﻿using System.Windows;
using System.Windows.Controls;

namespace Infrastructure.Services
{
    /// <summary>
    /// Window management services
    /// </summary>
    public class WindowServices : IWindowServices
    {
        /// <summary>
        /// The application's main window
        /// </summary>
        public Window MainWindow { get; set; }

        /// <summary>
        /// Displays a dialog window with the provided content
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        public void ShowDialogWindow(string title, UserControl content)
        {
            Window window = new Window()
                                {
                                    Title = title,
                                    MinHeight = 50,
                                    MinWidth = 50,
                                    Owner = MainWindow,
                                    Content = content,
                                    Width = content.Width,
                                    Height = content.Height
                                };
            window.ShowDialog();
        }
    }
}